/*******************************************************************************
 * Level Master 2000
 * Copyright (C) 2010 Christian Herzog
 * For more information see http://code.google.com/p/levelmaster2000/
 *
 * This file is licensed under the terms of the MIT license, see
 * http://www.opensource.org/licenses/mit-license.php for further information.
 ******************************************************************************/

#include "ClassInfo.h"

ClassInfo::ClassInfo()
{
}

ClassInfo::ClassInfo( QString fullClassName )
{
    QStringList split = fullClassName.split("::");

    if( split.size() == 1 )
    {
        name = split[0];
    }
    else
    {
        name = split[1];
        package = split[0].split(".");
    }
}

ClassInfo::ClassInfo(QString name, QStringList package)
    : name(name), package(package)
{
}

QString ClassInfo::buildFullClassName()
{
    QString ret;

    foreach( QString subPackage, package )
    {
        ret += subPackage + ".";
    }

    ret += name;

    return ret;
}
